package ahuy;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

import javax.sound.sampled.Line;
import javax.swing.JOptionPane;

public class thu {

	public static void main(String[] args) throws IOException {
//		ghiFile();
		docFile();

	}

	public static void ghiFile() {
		try {
			FileOutputStream fos = new FileOutputStream("hom nay ngay moi.txt");
			PrintWriter pw = new PrintWriter(fos);
			pw.print("2 4 6 1 2 4");
			pw.close();
			System.out.println("ghi file thanh cong");
			
		} catch (FileNotFoundException e) {
			
			e.printStackTrace();
		}
		
	}

	public static void docFile() throws IOException {
		FileReader fr = new FileReader("hom nay ngay moi.txt");
		BufferedReader read = new BufferedReader(fr);
		String line;
		line = read.readLine();
		while (line !=null){
			
			System.out.println(line);
		}
		fr.close();
	}
}
